import React, { Component } from "react";
import { connect } from 'react-redux';
import {fromJS} from 'immutable';
import { HomeWrap } from "./style";
import { Grid } from "antd-mobile";
class Home extends Component {
    render() {
        return (
            <HomeWrap>
                <div className="contentBox">
                    <div className="banner">
                        <img src={require("../../static/img/swiper.jpg")} alt="banner" />
                    </div>
                    <Grid
                        className="gridBox"
                        data={this.props.menuArr}
                        columnNum={4}
                        hasLine={false}
                        onClick={(i)=>{
                            // console.log(i,this.props)
                            this.props.history.push(i.url)
                        }}
                    />
                </div>
            </HomeWrap>
        );
    }
}
const mapStateToProps = (state, ownProps) => {
    state= fromJS(state);
    return {
        menuArr: state.getIn(["home", "menuArr"]).toJS(),
    };
};
const mapDispatchToProps = (dispatch, ownProps) => {
    return {
    };
};
export default connect(mapStateToProps, mapDispatchToProps)(Home);
